import request from "@/utils/request";
// 调用权限
export default {
  //查询文章栏目
  getCategoryList(data) {
    return request({
      url: "/api/news/category/",
      method: "get",
      params: data
    });
  },
  getSimpleList(data) {
    return request({
      url: "/api/news/category/simple/",
      method: "get",
      params: data
    });
  },
  //修改文章栏目
  editCategory(id, data) {
    return request({
      url: "/api/news/category/" + id + "/",
      method: "put",
      data: data
    });
  },
  //新增
  addCategory(data) {
    return request({
      url: "/api/news/category/",
      method: "post",
      data: data
    });
  },
  //删除
  deleteCategory(id) {
    return request({
      url: "/api/news/category/" + id + "/",
      method: "delete"
    });
  },
  //查看文章列表
  getList(data) {
    return request({
      url: "/api/news/",
      method: "get",
      params: data
    });
  },
  //修改文章
  editNews(id, data) {
    return request({
      url: "/api/news/" + id + "/",
      method: "put",
      data: data
    });
  },
  getDetailNewsById(id, data) {
    return request({
      url: "/api/news/" + id + "/",
      method: "get",
      data: data
    });
  },
  //新增文章
  addNews(data) {
    return request({
      url: "/api/news/",
      method: "post",
      data: data
    });
  },
  //删除文章
  deleteNews(id) {
    return request({
      url: "/api/news/" + id + "/",
      method: "delete"
    });
  },
  //推荐首页
  editCom(id, data) {
    return request({
      url: "/api/news/" + id + "/com/",
      method: "post",
      data: data
    });
  },
  //置顶
  editTop(id, data) {
    return request({
      url: "/api/news/" + id + "/top/",
      method: "post",
      data: data
    });
  },
  //审核
  editAllow(id, data) {
    return request({
      url: "/api/news/" + id + "/allow/",
      method: "post",
      data: data
    });
  },
  //排序
  editOrder(id, data) {
    return request({
      url: "/api/news/" + id + "/order/",
      method: "post",
      data: data
    });
  }
};
